package cn.lds.j367.ssm.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResultDTO<T> {
    private Integer code;
    private String msg;
    private T obj;

    public static ResultDTO builderSuccess(Object o){
        return new ResultDTO(0,"ok",o);
    }

    public static ResultDTO builderError(String msg){
        return new ResultDTO(-1,msg,null);
    }
}
